#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED

#include "vec3f.h"
#include <vector>

#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <GL/freeglut.h>

#include <stdlib.h>
#include <iostream>


using namespace std;

struct color
{
    GLfloat R;
    GLfloat G;
    GLfloat B;
};

struct Vertex
{
    GLfloat X;
    GLfloat Y;
    GLfloat Z;
    GLfloat R; //radius
    GLfloat A; //angle
};

struct Lines
{
    Vertex Start;
    Vertex End;
};

class VecBrick
{
    public:

    // Basic information
    bool Exist;         // does the bot exist
    float X;            // X coordinate
    float Y;            // Y coordinatee finite mass
    color BrickColor;   // color of the brick in RGB as GLfloats
    bool exists;        // does the brick exist or not?

    // more complex structures
    vector<Lines*> lines;   // each line has a start and end coordinate as a vertex


    VecBrick()    //constructor
    {

    };
    ~VecBrick()   //destructor
    {
        X = 0;
        Y = 0;
    };
};

class Ball
{
    public:
    float X;        //X coordinate of the ball
    float Y;        //Y coordinate of the ball
    float Xmove;    //amount to move the ball in the X axis
    float Ymove;    //amount to move the ball in the Y axis
    color BallColor; // Color of the ball in RGB as GLFloats


};


// This stuff should all be loaded from a file at some point
//class ConfigSetup
//{
//    public:

//    GLfloat Zoom;
//    ConfigSetup()   //constuctor
 //   {
//        Zoom = -4.1f;
//    };
//    ~ConfigSetup()  //destructor
//    {

//    };
//};

//Global variables

//ConfigSetup Config;     //global config

double Angle = 0.0f;
double MAX_X = 2.0f;
double MAX_Y = 2.0f;
double MIN_X = -2.0f;
double MIN_Y = -2.0f;

GLfloat PaddleLength = 0.5f;    //Maybe the paddle length will change due to power-ups
float PaddlePos = 0.0f;       //paddle position. It will only move in the X plain most likely
GLfloat PaddlePosY = -1.8f;      //vertical position of paddle
GLfloat BrickSize = 0.09f;      //how big is a brick anyway? could they change size in the game?
GLfloat Zoom = -4.1f;           //set the zoom level
//GLFWvidmode return_struct;      //struct to hold the screen width returned by a function

int botswitch = 0;

const GLfloat light_ambient[]  = { 0.0f, 0.0f, 0.0f, 1.0f };
const GLfloat light_diffuse[]  = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_position[] = { 2.0f, 5.0f, 5.0f, 0.0f };

const GLfloat mat_ambient[]    = { 0.7f, 0.7f, 0.7f, 1.0f };
const GLfloat mat_diffuse[]    = { 0.8f, 0.8f, 0.8f, 1.0f };
const GLfloat mat_specular[]   = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat high_shininess[] = { 100.0f };

const double PI = 3.14159265359;

//create the list to hold all the bricks.
vector <VecBrick*> BrickList;

//prototypes
int main(int argc, char *argv[]);
static void resize(int width, int height);
static void display(void);
static void key(unsigned char key, int x, int y);
void mouse(int btn, int state, int x, int y);
void mouseWheel(int button, int dir, int x, int y);
void mouseMove(int x, int y);
static void idle(void);
void Initialize();
void DrawScreen();


#endif // MAIN_H_INCLUDED
